<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

Route::get('/', array('as' => 'public','uses' => 'HomeController@showHome'));

Route::get('admin', array('as' => 'admin','uses' => 'AdminController@showAdmin'))->before('auth');
Route::get('admin/home', array('as' => 'home','uses' => 'AdminController@showAdmin'))->before('auth');
Route::get('admin/post', array('as' => 'post','uses' => 'AdminController@showPost'))->before('auth');
Route::get('admin/collection', array('as' => 'collection','uses' => 'AdminController@showCollection'))->before('auth');
Route::get('admin/test', array('as' => 'test','uses' => 'AdminController@showTest'))->before('auth');

Route::get('admin/login', array('as' => 'login','uses' => 'LoginController@showLogin'))->before('guest');
Route::post('admin/login', array('uses' => 'LoginController@doLogin'));

Route::get('admin/logout', array('as' => 'logout','uses' => 'AdminController@logout'))->before('auth');

Route::post('admin/searchimage', array('uses' => 'GrabController@searchimage'));
Route::post('admin/saveimage', array('uses' => 'GrabController@saveimage'));
Route::get('admin/gimgapi', array('uses' => 'GrabController@gimgapi'));
Route::post('admin/debug', array('uses' => 'GrabController@debug'));
